home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_urt.idb / usr / freeware / catman / u_man / cat5 / RLE.Z / RLE
Encoding:
Text File  |  1999-01-26  |  6.7 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      RRRRLLLLEEEE((((5555))))            5555 ((((9999////11114444////88882222))))            RRRRLLLLEEEE((((5555))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       rle -    Run length encoded file    format produced    by the rle
  10.       library
  11.  
  12.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  13.       The output file format is (note: all words are 16 bits, and
  14.       in PDP-11 byte order):
  15.  
  16.       WWWWoooorrrrdddd 0000
  17.            A "magic" number    0xcc52.     (Byte order 0x52, 0xcc.)
  18.  
  19.       WWWWoooorrrrddddssss    1111----4444
  20.            The structure (chars saved in PDP-11 order)
  21.  
  22.            {
  23.            short   xpos,               /* Lower    left corner
  24.                ypos,
  25.                xsize,               /* Size of saved    box
  26.                ysize;
  27.            }
  28.  
  29.       BBBByyyytttteeee 11110000
  30.            (_f_l_a_g_s) The following flags are defined:
  31.  
  32.            _H__C_L_E_A_R_F_I_R_S_T
  33.             (0x1) If set, clear    the frame buffer to background
  34.             color before restoring.
  35.  
  36.            _H__N_O__B_A_C_K_G_R_O_U_N_D
  37.             (0x2) If set, no background    color is supplied.  If
  38.             _H__C_L_E_A_R_F_I_R_S_T is also set, it should    be ignored (or
  39.             alternatively, a clear-to-black operation could be
  40.             performed).
  41.  
  42.            _H__A_L_P_H_A
  43.             (0x4) If set, an alpha channel is saved as color
  44.             channel -1.     The alpha channel does    not contribute
  45.             to the count of colors in _n_c_o_l_o_r_s.
  46.  
  47.            _H__C_O_M_M_E_N_T
  48.             (0x8) If set, comments will    follow the color map
  49.             in the header.
  50.  
  51.       BBBByyyytttteeee 11111111
  52.            (_n_c_o_l_o_r_s) Number    of color channels present.  0 means
  53.            load only the color map (if present), 1 means a B&W
  54.            image, 3    means a    normal color image.
  55.  
  56.       BBBByyyytttteeee 11112222
  57.            (_p_i_x_e_l_b_i_t_s) Number of bits per pixel, per color
  58.            channel.     Values    greater    than 8 currently will not
  59.            work.
  60.  
  61.  
  62.  
  63.      Page 1                         (printed 12/1/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      RRRRLLLLEEEE((((5555))))            5555 ((((9999////11114444////88882222))))            RRRRLLLLEEEE((((5555))))
  71.  
  72.  
  73.  
  74.       BBBByyyytttteeee 11113333
  75.            (_n_c_m_a_p) Number of color map channels present.  Need not
  76.            be identical to _n_c_o_l_o_r_s.     If this is non-zero, the
  77.            color map follows immediately after the background
  78.            colors.
  79.  
  80.       BBBByyyytttteeee 11114444
  81.            (_c_m_a_p_l_e_n) Log base 2 of the number of entries in    the
  82.            color map for each color    channel.  I.e.,    would be 8 for
  83.            a color map with    256 entries.
  84.  
  85.       BBBByyyytttteeeessss    11115555----............
  86.            The background color.  There are    _n_c_o_l_o_r_s    bytes of
  87.            background color.  If _n_c_o_l_o_r_s is    even, an extra padding
  88.            byte is inserted    to end on a 16 bit boundary.  The
  89.            background color    is only    present    if _H__N_O__B_A_C_K_G_R_O_U_N_D is
  90.            not set in _f_l_a_g_s.  IF _H__N_O _B_A_C_K_G_R_O_U_N_D is    set, there is
  91.            a single    filler byte.  Background color is ignored, but
  92.            present,    if _H__C_L_E_A_R_F_I_R_S_T    is not set in _f_l_a_g_s.
  93.  
  94.            If _n_c_m_a_p    is non-zero, then the color map    will follow as
  95.            _n_c_m_a_p*2^_c_m_a_p_l_e_n 16 bit words.  The color    map data is
  96.            left justified in each word.
  97.  
  98.            If the _H__C_O_M_M_E_N_T    flag is    set, a set of comments will
  99.            follow.    The first 16 bit word gives the    length of the
  100.            comments    in bytes.  If this is odd, a filler byte will
  101.            be appended to the comments.  The comments are
  102.            interpreted as a    sequence of null terminated strings
  103.            which should be,    by convention, of the form _n_a_m_e=_v_a_l_u_e,
  104.            or just _n_a_m_e.
  105.  
  106.            Following the setup information is the Run Length
  107.            Encoded image.  Each instruction    consists of an opcode,
  108.            a datum and possibly one    or more    following words    (all
  109.            words are 16 bits).  The    opcode is encoded in the first
  110.            byte of the instruction word.  Instructions come    in
  111.            either a    short or long form.  In    the short form,    the
  112.            datum is    in the second byte of the instruction word; in
  113.            the long    form, the datum    is a 16    bit value in the word
  114.            following the instruction word.    Long form instructions
  115.            are distinguished by having the 0x40 bit    set in the
  116.            opcode byte.  The instruction opcodes are:
  117.  
  118.       SSSSkkkkiiiippppLLLLiiiinnnneeeessss ((((1111))))
  119.            The datum is an unsigned    number to be added to the
  120.            current Y position.
  121.  
  122.       SSSSeeeettttCCCCoooolllloooorrrr ((((2222))))
  123.            The datum indicates which color is to be    loaded with
  124.            the data    described by the following ByteData and
  125.            RunData instructions.  Typically, 0->red, 1->green,
  126.  
  127.  
  128.  
  129.      Page 2                         (printed 12/1/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      RRRRLLLLEEEE((((5555))))            5555 ((((9999////11114444////88882222))))            RRRRLLLLEEEE((((5555))))
  137.  
  138.  
  139.  
  140.            2->blue.     The operation also resets the X position to
  141.            the initial X (i.e. a carriage return operation is
  142.            performed).
  143.  
  144.       SSSSkkkkiiiippppPPPPiiiixxxxeeeellllssss ((((3333))))
  145.            The datum is an unsigned    number to be added to the
  146.            current X position.
  147.  
  148.       BBBByyyytttteeeeDDDDaaaattttaaaa ((((5555))))
  149.            The datum is one    less than the number of    bytes of color
  150.            data following.    If the number of bytes is odd, a
  151.            filler byte will    be appended to the end of the byte
  152.            string to make an integral number of 16-bit words.  The
  153.            X position is incremented to follow the last byte of
  154.            data.
  155.  
  156.       RRRRuuuunnnnDDDDaaaattttaaaa ((((6666))))
  157.            The datum is one    less than the run length.  The
  158.            following word contains (in its lower 8 bits) the color
  159.            of the run.  The    X position is incremented to follow
  160.            the last    byte in    the run.
  161.  
  162.       EEEEOOOOFFFF ((((7777))))
  163.            This opcode indicates the logical end of    image data.  A
  164.            physical    end-of-file will also serve as well.  The EEEEOOOOFFFF
  165.            opcode may be used to concatenate several images    in a
  166.            single file.
  167.  
  168.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  169.       _l_i_b_r_l_e(_3)
  170.  
  171.      AAAAUUUUTTTTHHHHOOOORRRR
  172.       Spencer W. Thomas, Todd Fuqua
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                         (printed 12/1/98)
  196.  
  197.  
  198.  
  199.